package com.example.administrator.audioandvideo

import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Paint
import android.os.Environment
import android.view.View
import java.io.File

class CustomViewKotlin(context: Context?) : View(context) {
    val paint = Paint()
    var bitmap: Bitmap? = null

    init{
        paint.isAntiAlias = true
        paint.style = Paint.Style.STROKE
        bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory().path+ File.separator)
    }

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        if (bitmap!=null){
            canvas!!.drawBitmap(bitmap,0f,0f,paint)
        }

    }
}